#ifndef ISCENEMANAGER_H
#define ISCENEMANAGER_H

#include "Framework/Prerequisites.h"
#include "Camera/Camera.h"
#include "Graphics/IViewport.h"

namespace tyro
{
	namespace Scene
	{
		class ISceneManager {
		public:

			typedef map<String, SceneNode*>::type SceneNodeMap;

			virtual void SetActiveRenderEngine(Graphics::IRenderEngine* destRenderEngine);
			virtual void RenderScene(Camera::Camera* camera, Graphics::IViewport* viewport);
			virtual void UpdateSceneGraph(void);
			virtual void Init();

			virtual Camera::Camera* CreateCamera();
			void SetViewport( Graphics::IViewport* viewport );
			void SetViewMatrix( Math::Matrix4f viewMatrix );
			virtual IRenderQueue* GetRenderQueue(void);
			virtual void InitialiseRenderQueue();
			void FindVisibleObjects( Camera::Camera* activeCamera );

			virtual void RenderObject( Graphics::IRenderable* rend );
			void RenderVisibleObjects( void );
			void RenderQueuedGroupObjects( IRenderQueueGroup* rendGroup );
			void RenderBasicQueuedGroupObjects( IRenderQueueGroup* rendGroup );
			void RenderObjects( const IRenderableCollection& objs );

			virtual SceneNode* GetRootSceneNode(void); 
			SceneNode* CreateRootSceneNodeImpl( String name );
			virtual SceneNode* CreateSceneNode( void );
			virtual SceneNode* CreateSceneNode( const String& name );
			virtual SceneNode* CreateSceneNodeImpl( void );
			virtual SceneNode* CreateSceneNodeImpl( const String& name );
			void SetPass( Graphics::Pass* pass );
		protected:
			


		private:
			SceneNode*		sceneRoot;
			SceneNodeMap	sceneNodeMap;
			Camera::Camera* activeCamera;
			Graphics::IViewport* activeViewport;
			Graphics::IRenderEngine* activeRenderEngine;
			IRenderQueue*			activerRenderQueue;
			Math::Matrix4f activeViewMatrix;
			Math::Matrix4f tempMatrices[256];
			bool cameraRelativeRendering;
			Math::Vector3f cameraRelativePosition; 
			bool updateVisibleObjects;
		};

	}
}

#endif